﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;


namespace SimNations.City
{
    public class CityTile2D : CityTile
    {
        // MEMBER VARIABLES
        // ------------------------------------------------------------------------------------------------------------------------

        CityTileSprite m_Sprite = null;


        // CONSTRUCTORS
        // ------------------------------------------------------------------------------------------------------------------------

        public CityTile2D()
            : base()
        {

        } // end CityTile::CityTile2D()

        public CityTile2D(float X, float Y, ACity ParentCity)
            : base(X, Y, ParentCity)
        {

            m_Sprite = new CityTileSprite(m_Position.X * 32,
                                          m_Position.Y * 32,
                                          MathHelper.ToRadians(0),
                                          "Content/ZonesTest");

            m_TransitType = TransitTypes.None;
            m_ZoneType = Zones.None;

            m_Sprite.SourceRectangle = new Rectangle(((int)m_ZoneType) * 32, 0, 32, 32);
            m_Sprite.ParentComponent = this;

        } // end CityTile2D::CityTile2D(float, float)


        // PRIVATE/PROTECTED METHODS
        // ------------------------------------------------------------------------------------------------------------------------

        protected override void Load()
        {
            base.Load();


            m_Sprite.ParentCityTile = this;

            m_Sprite.LoadComponent();
        }


        // METHODS
        // ------------------------------------------------------------------------------------------------------------------------

        public override void Draw()
        {
            m_Sprite.DrawOffset(this.ParentCity.Position, this.ParentCity.ParentGameScreen);

        } // end CityTile2D::Draw()


        // DEBUG METHODS
        // ------------------------------------------------------------------------------------------------------------------------

#if (DEBUG)
        // put all debug methods in here...
#endif


        // PROPERTIES
        // ------------------------------------------------------------------------------------------------------------------------

        public CityTileSprite Sprite
        {
            get
            {
                return m_Sprite;
            }
            set
            {
                m_Sprite = value;
            }
        } // end property Sprite

        public override TransitTypes TransitType
        {
            get
            {
                return m_TransitType;
            }
            set
            {
                m_TransitType = value;

                m_Sprite.SourceRectangle = new Rectangle(13 * 32, 0, 32, 32);
            }
        } // end property TransitType

        public override Zones ZoneType
        {
            get
            {
                return m_ZoneType;
            }
            set
            {
                m_ZoneType = value;

                m_Sprite.SourceRectangle = new Rectangle(((int)m_ZoneType) * 32, 0, 32, 32);
            }
        } // End property ZoneType


        // EVENTS
        // ------------------------------------------------------------------------------------------------------------------------

        
    } // end CityTile2D

}
